﻿@using Framework.HtmlHelpers
@using WebUI.Areas.Admin.Models.Common
@using WebUI.Extensions
@using Domain
@model IList<CourseTable>
@{
	Layout = "~/Areas/Admin/Views/Shared/_AdminContent.cshtml";
	StudentInfo currentStudent = ViewBag.CurrentStudent;
	ClazzInfo currentClazz = ViewBag.CurrentClazz;
	int evaTaskId = ViewBag.EvaTaskId;
	EvaTask evaTask = ViewBag.EvaTask;
	IList<int> isEvaedTeacherList = ViewBag.IsEvaedTeacherList;
}
@section head {
	<style>
		table tr td {
			vertical-align: middle !important;
		}
	</style>
}
@section body {
	<script>

		function showMessage(message, type) {
			$("#js-message").fadeIn();
			switch (type) {
				case -1:
					$("#js-message").attr("class", "alert alert-danger").find(".message").html(message);
					break;
				case 1:
					$("#js-message").attr("class", "alert alert-success").find(".message").html(message);
					break;
			}
			// 3s 后隐藏
			setTimeout(function () {
				$("#js-message").fadeOut("slow");
			}, 3000);
		}

		$(function () {

		});
	</script>
}


<!-- start 提示框 -->
@{ Html.RenderPartial("_MessagePartial"); }
<!-- end 提示框 -->
<!-- start .box -->
<div class="box">
	<!-- start .box-header -->
	<div class="box-header">
		<h3 class="box-title">
			<span class="col-xs-12" style="padding-bottom: 10px;">评价任务: @evaTask.Name</span>
			<span class="col-xs-12" style="padding-bottom: 10px;">
				@(currentStudent?.Name ?? "")（@(currentStudent?.StudentCode ?? "")）
			</span>
			<span class="col-xs-12">
				@(currentClazz?.ClazzCode ?? "") 班
			</span>
		</h3>

		<div class="box-tools"></div>
	</div>
	<!-- end .box-header -->
	<!-- start .box-body -->
	<!-- start 简单表格 -->
	<div class="box-body table-responsive no-padding">
		<table id="js-table" class="table table-hover" pview="table">
			<tr>
				<th>ID</th>
				<th>课程</th>
				<th>授课教师</th>
				<th>操作</th>
			</tr>
			@if (Model != null && Model.Count >= 1)
			{
				foreach (var item in Model)
				{
					<tr>
						<td>@item.ID</td>
						<td>@item.Course.Name - @item.Course.CourseCode</td>
						<td>@item.Teacher.Name - @item.Teacher.EmployeeCode</td>
						<td>
							<div class="btn-group">
								@if (isEvaedTeacherList.Contains(item.Teacher.ID))
								{
									// 已评
									<a class="btn btn-default disabled" disabled href="#">已评</a>
								}
								else
								{
									// 未评
									<a class="btn btn-primary" href="/Admin/StudentEva/Eva?courseTableId=@item.ID&evaTaskId=@evaTaskId">评价</a>
								}
							</div>
						</td>
					</tr>
				}
			}
		</table>
	</div>
	<!-- end 简单表格 -->
	<!-- end .box-body -->
	<!-- start .box-footer -->
	<div class="box-footer clearfix">
		<div class="btn-group">
			<a class="btn btn-default" href="/Admin/StudentEva">返回</a>
		</div>
	</div>
	<!-- end .box-footer -->
</div>
<!-- end .box -->
